package com.common.retrofit.methods;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class BindCarPhoneMethods extends BaseMethods {

    private static BindCarPhoneMethods m_ins = null;

    public static BindCarPhoneMethods getInstance() {
        if (m_ins == null) {
            synchronized (BindCarPhoneMethods.class) {
                if (m_ins == null) {
                    m_ins = new BindCarPhoneMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void MobileBind (Subscriber<Object> subscriber,
                      int uid
                      ,String hashid
                      ,String authid
                      ,String mobile
                      ,String sms_code
    ) {
        Observable observable = initService().MobileBind(System.currentTimeMillis()+"",
                SortUtils.getMyHash("uid","hashid","authid","mobile","sms_code"), Constans.ANDROID_APP_ID,"3",uid,hashid,authid,mobile,sms_code
        );
        toSubscribe(observable, subscriber);
    }
}
